<div id="head_tmp">

    <? if (SessionMsg::hasMessage()) {
            ?>
    <span id="login_form_error">
    <? foreach (SessionMsg::pollMessageByCode(MSG_HEAD) as $message) {echo $message;} ?>
    </span>
    <?}
    if ($_SESSION["login"]=='anonyme') {
?>
    <form action="<?=$_SERVER["SCRIPT_NAME"]?>?login" method="post">
        <input name="login" type="text"/>
        <input name="pwd" type="password"/>
        <input name="kpcookie" type="checkbox" value="checked"/>
        <input name="submit" value="login" type="submit"/>
        <a href="signup.php">Sign up</a>
    </form>
    <?
    } else {
        echo "Welcome! ".$_SESSION["login"];
    ?>
        <a href="index.php?logout">Logout</a>
    <?
    }
    ?>
</div>
